//
//  PopoverViewController.swift
//  MacStudy
//
//  Created by 30san on 2020/10/10.
//  Copyright © 2020 Dawninest. All rights reserved.
//

import Cocoa

class PopoverViewController: NSViewController {

    private lazy var popver: NSPopover = {
        let popver = NSPopover()
        
        let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil)
        let vc = storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier.init("BaseTableViewController")) as! NSViewController
        popver.contentViewController = vc
        popver.behavior = .transient
        return popver
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do view setup here.
    }
    
    @IBAction func clickOpen(_ sender: NSButton) {
        popver.show(relativeTo: sender.bounds, of: sender, preferredEdge: NSRectEdge.minY)
    }
}
